<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SpotList.ascx.cs" Inherits="admin_SpotList" %>
<script type="text/javascript">
    var the_url = "";
    function get_text() {
        the_url ="Default.aspx?ctrl=fbs&search="+ document.getElementById("txtSearch").value;
    }
</script>
<table>
    <tr>
        <td style="width: 154px">
            <asp:Label ID="Label1" runat="server" Text="Enter text to search:"></asp:Label></td>
        <td style="width: 100px">
            <input id="txtSearch" type="text" /></td>
        <td style="width: 100px">
            <a  onclick="get_text();" href="javascript:location=the_url" class="c_button">Search</a>
        </td>
    </tr>
</table>
<asp:Label ID="Label2" runat="server" Text="List of tour spots:"></asp:Label><br />
<asp:GridView ID="dgrSpot" runat="server" AutoGenerateColumns="False" CssClass="list_table" DataKeyNames="Id">
    <Columns>
        <asp:TemplateField>        
            <ItemTemplate>
                <asp:CheckBox ID="chkChoice" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Name" HeaderText="Name" />
        <asp:BoundField DataField="Description" HeaderText="Description" />
        <asp:TemplateField HeaderText="Is published" ItemStyle-HorizontalAlign="center">
            <ItemTemplate>
                <asp:CheckBox ID="chkState" Enabled="false" runat="server" Checked='<%#Bind("State") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Category">
            <ItemTemplate>  
                <asp:Label ID="lblCateName" runat="server" Text='<%#Eval("Category.Name") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <a href='Default.aspx?ctrl=spot&mode=1&id=<%#Eval("Id") %>'>Edit</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<div id="paging_bar"><asp:Label ID="lblPaging" runat="server"></asp:Label></div>
<asp:LinkButton ID="lnkDelete" CssClass="lnkDelete" runat="server"  OnClick="lnkDelete_Click">Delete selected items</asp:LinkButton>
